/* 
品牌管理相关的接口请求函数
*/
import request from '@/utils/request'

/* 
获取品牌分页列表
GET /admin/product/baseTrademark/{page}/{limit}
GET /admin/product/baseTrademark/getTrademarkList
*/
export function getList(page, limit) {
  
  // return request(`/admin/product/baseTrademark/${page}/${limit}`)
  /* return request({
    url: `/admin/product/baseTrademark/${page}/${limit}`,
    method: 'GET'
  }) */
  if (page && limit) {
    return request.get(`/admin/product/baseTrademark/${page}/${limit}`)
  } else {
    return request.get(`/admin/product/baseTrademark/getTrademarkList`)
  }
}

/* 
添加品牌
POST /admin/product/baseTrademark/save
trademark的格式: 
  {
    "logoUrl": "string",
    "tmName": "string"
  }
*/
export function add (trademark) {
  return request.post('/admin/product/baseTrademark/save', trademark)
}

/* 
更新品牌
PUT /admin/product/baseTrademark/update
trademark的结构:
  {
    id: 1
    "logoUrl": "string",
    "tmName": "string"
  }
*/
export function update(trademark) {
  return request.put('/admin/product/baseTrademark/update', trademark)
}

/* 
删除品牌
DELETE /admin/product/baseTrademark/remove/{id}
*/
export function remove (id) {
  return request.delete(`/admin/product/baseTrademark/remove/${id}`)
}